package com.example.myapplication2.Dao;

import androidx.room.*;
import com.example.myapplication2.POJO.Book;

import java.util.List;

@Dao
public interface BookDao {
    //新增
    @Insert
    void insert (Book... books);

    @Delete
    void delete(Book... books);

    @Query("DELETE FROM Book")
    void deleteAll();
    @Update
    int update(Book... books);
    //加载所有
    @Query("SELECT * FROM Book")
    List<Book> queryAll();

    @Query("SELECT * FROM Book where bookName= :bookName Limit 1")
    Book queryByName(String bookName);
}
